package com.example.user_api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.user_model.dto.UserDTO;
import com.example.user_model.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: sjz
 * @since: 2024/7/3 19:56
 */
@FeignClient(
        name = "take-out-user",
        contextId = "take-out-user"
)
@Component
public interface UserClient {

    @PostMapping("/userApi/validate")
    String validate(@RequestBody UserDTO userDTO);
    @PostMapping("/userApi/getOne")
    User getOne(LambdaQueryWrapper<User> wrapper);
//    @PostMapping("/userApi/id")
//    User getUser(String id);

    @GetMapping("/userApi/id")
    User getById(@RequestParam("id") String id);
}
